function Circle (origin, radius) {
    this.origin = origin;
    this.radius = radius;
}

Circle.prototype = {
    constructor: Circle,
    getBox: function(){
        return new Rectangle(new Point(this.origin.x - this.radius, this.origin.y - this.radius),2*this.radius,2*this.radius);
    },
    getIntersectionFromCenterToPoint: function(point){
        var deltaX = point.x - this.origin.x,
            deltaY = point.y - this.origin.y;

        if (deltaX == 0 || deltaY == 0){
            return this.getBox().getIntersectionFromCenterToPoint(point);
        }

        var m = deltaY / deltaX,
            mSquared = m * m,
            xRadiusSquared = yRadiusSquared = this.radius * this.radius,
            x = Math.sqrt(1 / ((1 / xRadiusSquared) + (mSquared / yRadiusSquared)));

        if (deltaX < 0){
            x = -x;
        }

        var y = m * x;

        return new Point(this.origin.x + x, this.origin.y + y);
    }
}